<template>
  <div>
    <div class="list-btn">
      姓名:<Input v-model.trim="params.realname" placeholder="请输入姓名" style="width: 200px" clearable @keyup.enter.native="getList(url)" />
    </div>
    <div class="list-btn">
      手机号:<Input v-model.trim="params.phone" placeholder="请输入手机号" style="width: 200px" clearable @keyup.enter.native="getList(url)" />
    </div>
    <div class="list-btn">
      订单号:<Input v-model.trim="params.nid" placeholder="请输入订单号" style="width: 200px" clearable @keyup.enter.native="getList(url)" />
    </div>
    <div class="list-btn">
      申请时间:<DatePicker type="date" @on-change="startTime"  placeholder="选择开始时间" style="width: 200px" ></DatePicker>
      ～<DatePicker type="date" @on-change="endTime"  placeholder="选择结束时间" style="width: 200px"  ></DatePicker>
    </div>
    <div class="list-btn">
      <Button type="primary" @click="getList(url,'refresh')">搜索</Button>
    </div>
    <page-list :listTitle="listTitle" :list="list" :loading="loading" @selectItem="ids = $event;"></page-list>
    <page-button :current="params.pageCurrent"  :total="total" @changePageNum="params.pageCurrent = $event; getList(url)" @changePageSize="params.pageLimit = $event; getList(url)"></page-button>
  </div>
</template>

<script>
  import listMixin from '../../mixin/list'
  import pageList from '../../template/listTemplate'
  import pageButton from '../../template/pageBtnTemplate'
  import confirmDialog from '../../template/confirmDialogTemplate'
  export default {
    mixins:[listMixin],
    components: {
      pageList,
      pageButton,
      confirmDialog
    },
    data () {
      return {
        nameList:[],
        tag: {
          'title': '审核拒绝',
          'path': '/work/auditReject/list'
        },
        listTitle: [
          {
            title: '订单号',
            minWidth: 220,
            key: 'nid',
            align:'left',
          },
          {
            title: '用户姓名',
            key: 'realname',
            minWidth:150,
            align:'center'
          },
          {
            title: '手机号',
            key: 'phone',
            minWidth:150,
            align:'center',
            render: (h, params) => {
              let phone = params.row.phone;
              return h('div', `${phone.substr(0,3)}****${phone.substr(7)}`)
            }
          }, {
            title: '借款金额(元)',
            key: 'money',
            minWidth:150,
            align:'center',
            render: (h, params) => {
              return h('div', this.toYuan(params.row.money))
            }
          },
          {
            title: '借款费用(元)',
            key: 'totalCost',
            minWidth:140,
            align:'center',
            render: (h, params) => {
              return h('div', this.toYuan(params.row.totalCost))
            }
          },
          {
            title: '借款周期(天)',
            key: 'day',
            minWidth:140,
            align:'center'
          },
          {
            title: '银行名称',
            key: 'bankName',
            minWidth:140,
            align:'center'
          },
          {
            title: '银行卡号',
            key: 'bankNum',
            minWidth:200,
            align:'center'
          },
         /* {
            title: '审核时间',
            key: 'reviewTime',
            minWidth:200,
            align:'center',
            render: (h, params) => {
              return h('div', params.row.reviewTime ? this.getLocalTime(params.row.reviewTime) : "—")
            }
          },*/
          {
            title: '申请时间',
            key: 'createTime',
            width:200,
            align:'center',
            render: (h, params) => {
              let texts = '';
              texts = this.getLocalTime(params.row.createTime);
              return h('div',texts)
            }
          },
          {
            title: '状态',
            key: 'status',
            minWidth:140,
            align:'center',
            render: (h, params) => {// 审核状态 0正在审核 1审核通过 2审核拒绝
              let d = this.getStatus(params.row.status);
              let texts = '';
              texts = d.txt
              return h('div', {
                props: {},
                style:{
                  color:d.color
                }
              }, texts)
            },
          },
        /*  {
            title: '拒绝原因',
            key: 'remark',
            minWidth:240,
            align:'left',

          },
           {
            title: '是否人工审核',
            key: 'reviewStatus',
            minWidth:110,
            align:'center',
            render: (h, params) => {// 是否人工审核标识 0 否 1是
              let texts = '';
              texts = this.isReview(params.row.reviewStatus)
              return h('div', {
                props: {},
              }, texts)
            },
          },*/
        ],
        url: '/bkuserloan/fail/list',
        nameListUrl: '',
        params: {
          pageCurrent: 1,
          pageLimit: 10
        },

      }
    },
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .list-btn{
    margin-bottom: 5px;
    margin-right: 5px;
    display: inline-block;
  }
  .refresh-btn{
    float: right;
  }

</style>
